{{define "Title"}}第三方包{{end}}
{{define "ContentWidth"}}8{{end}}
{{define "Breadcrumb"}}
	<ul class="breadcrumb">
		<li><a href="/"><i class="glyphicon glyphicon-home"></i> 首页</a></li>
		<li><a href="/packages">第三方包</a></li>
		<li class="active">{{.category.Name}}</li>
	</ul>
{{end}}
{{define "Content"}}
	<div class="content">
		<h1>Go语言第三方包：{{.category.Name}}</h1>
		<dl class="topics">
			{{range .packages}}
			{{$category := .Category $.db}}
            {{$creater := .Creater $.db}}
			<dd>
				<a href="/p/{{.Id_.Hex}}" class="title">{{.Title}}</a>
				{{if $.username}}
					{{if .CanEdit $.username $.db}}
						<a href="/p/{{.Id_.Hex}}/edit"><i class="icon-pencil"></i></a>
						<a href="/p/{{.Id_.Hex}}/delete" onclick="javascript:return confirm('确定要删除吗？');"><i class="icon-remove"></i></a>
					{{end}}
				{{end}}
				<div class="space"></div>
				<div class="info">
					<a class="label label-info" href="/packages/{{$category.Id}}">{{$category.Name}}</a> •
					<a href="/member/{{$creater.Username}}"><strong>{{$creater.Username}}</strong></a> •
					{{formattime .CreatedAt}} 提交
				</div>
				<div class="space"></div>
				<p class="muted">
					{{$.utils.Truncate .Html 200}}
				</p>
				<div class="clear"></div>
			</dd>
			{{end}}
		</dl>
	</div>
{{end}}

{{define "LeftSide"}}{{end}}

{{define "RightSide"}}
	<div class="col-md-4 sidebar">
	    <a href="/package/new" class="btn btn-primary btn-lg btn-block" style="margin-bottom: 20px;">提交第三方包</a>
		<div class="well sidebar-nav">
			<h4><small>分类</small></h4>
			<ul class="nav">
				{{range .categories}}
				<li><a href="/packages/{{.Id}}">{{.Name}}<span class="badge pull-right">{{.PackageCount}}</span></a></li>
				{{end}}
		    </ul>
		</div>
	</div>
{{end}}
